package mviewer.types;

public class VectorData implements IVector, IWritableVector {

	private float x, y, z;

	public VectorData() {
		x = y = z = 0f;
	}

	public VectorData(float x, float y, float z) {
		this.x = x;
		this.y = y;
		this.z = z;
	}

	public VectorData(IVector v) {
		this(v.getX(), v.getY(), v.getZ());
	}

	@Override
	public float getX() {
		return x;
	}

	@Override
	public void setX(float x) {
		this.x = x;
	}

	@Override
	public float getY() {
		return y;
	}

	@Override
	public void setY(float y) {
		this.y = y;
	}

	@Override
	public float getZ() {
		return z;
	}

	@Override
	public void setZ(float z) {
		this.z = z;
	}

	@Override
	public String toString() {
		return String.format("(%.1f, %.1f, %.1f)", x, y, z);
	}

}
